<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"
    
    %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>執行新增系統設定</title>
</head>
<body>
<% if(session.getAttribute("access") == "y" ){%>
<jsp:useBean id="mydb" scope="page" class="bean.ConDbBean"/> <%//連結資料庫的bean %>
<%
String name = new String(request.getParameter("name").getBytes("iso-8859-1"),"utf-8"); //防止亂碼
String value=new String(request.getParameter("value").getBytes("iso-8859-1"),"utf-8");
String desc=new String(request.getParameter("desc").getBytes("iso-8859-1"),"utf-8");

String sql="INSERT INTO SYS_SETTING(S_NAME,S_VALUE,S_DESC)"+
" VALUES('"+name+"','"+value+"','"+desc+"')";
mydb.executeInsert(sql);

response.sendRedirect("lookSetting.jsp");
%>

<%
  }
  else{
  	response.sendRedirect("../index.jsp"); //若沒有登入則回到index.jsp
  } 
  %>
</body>
</html>